package io.lckgroup.modules.lck.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.lckgroup.modules.lck.entity.OrderMainEntity;
import io.lckgroup.modules.lck.entity.appvo.OrderMainEntityVo;
import io.lckgroup.modules.lck.form.wxgzh.OrderMainMerchantWxgzhFrom;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * 订单主表
 *
 * @author srq
 * @email siruiqi@siruiqi.com
 * @date 2020-01-19 19:14:39
 */
@Mapper
@Repository("orderMainDao")
public interface OrderMainDao extends BaseMapper<OrderMainEntity> {
    /**
     * 根据用户id查询订单（按订单状态分页查询）
     * @param page
     * @param orderState
     * @param id
     * @return
     */
    IPage<OrderMainMerchantWxgzhFrom> getOrderByState(Page page,@Param("orderState") String orderState,@Param("id") Long id,@Param("merchantId") String merchantId);

    Map<String, Object> getTodayCountData(Map<String, Object> params);

    Map<String, Object> getWeekCountData(Map<String, Object> params);

    Map<String, Object> getMonthCountData(Map<String, Object> params);

    Map<String, Object> getDynamicCountData(Map<String, Object> p);

    OrderMainEntityVo getMsgDefineById(String id);

    int cancelOrderTask();

    List<OrderMainEntity> selectCancelOrder();

    List<Map<String,String>> selectOrderNumByMonth(int isPay,String gmtCreate,String gmtCreates);
}
